﻿using System;
using System.Collections.Generic;
using System.Text;
using System.Data;

namespace Model
{
    [Serializable]
    public partial class Sys0a03
    {
		private string _modulecode;
		private string _modulename;
		private string _parentcode;
        private int? _sortorder;
		private string _plist;
		private string _purl;
		private string _pdact;
		private string _enable;
		private string _remark;
        private DateTime? _mdate;
		private string _muser;
		
        /// <summary>
        /// 模块编码
        /// </summary>
		public string Modulecode
		{
			get { return _modulecode;	 }
			set { _modulecode=value;	}
		}
        /// <summary>
        /// 模块名称
        /// </summary>
		public string Modulename
		{
			get { return _modulename;	 }
			set { _modulename=value;	}
		}
        /// <summary>
        /// 父级模块
        /// </summary>
		public string Parentcode
		{
			get { return _parentcode;	 }
			set { _parentcode=value;	}
		}
        /// <summary>
        /// 顺序编号
        /// </summary>
		public int? Sortorder
		{
			get { return _sortorder;	 }
			set { _sortorder=value;	}
		}
        /// <summary>
        /// 权限列表
        /// </summary>
		public string Plist
		{
			get { return _plist;	 }
			set { _plist=value;	}
		}
        /// <summary>
        /// 入口
        /// </summary>
		public string Purl
		{
			get { return _purl;	 }
			set { _purl=value;	}
		}
        /// <summary>
        /// 默认功能代码
        /// </summary>
		public string Pdact
		{
			get { return _pdact;	 }
			set { _pdact=value;	}
		}
        /// <summary>
        /// 是否启用
        /// </summary>
		public string Enable
		{
			get { return _enable;	 }
			set { _enable=value;	}
		}
        /// <summary>
        /// 备注
        /// </summary>
		public string Remark
		{
			get { return _remark;	 }
			set { _remark=value;	}
		}
        /// <summary>
        /// 修改时间
        /// </summary>
		public DateTime? Mdate
		{
			get { return _mdate;	 }
			set { _mdate=value;	}
		}
        /// <summary>
        /// 维护者
        /// </summary>
		public string Muser
		{
			get { return _muser;	 }
			set { _muser=value;	}
		}
		
		public static List<Sys0a03> GetSys0a03ListByDataTable(DataTable dt)
		{
			if(dt == null) return null;
		    List<Sys0a03> list = new List<Sys0a03>();
		   
			foreach(DataRow dr in dt.Rows)
            {
				Sys0a03 model = GetSys0a03ByDataRow(dr);
				if(null == model) continue;
				
				list.Add(model);
            }
           return list;
		}
		
		public static Sys0a03 GetSys0a03ByDataRow(DataRow dr)
		{
			Sys0a03 model = new Sys0a03(); //实例化Sys0a03
	
			DataColumnCollection dcc = dr.Table.Columns;

			if (dcc.Contains("modulecode")&&!(dr["modulecode"] is System.DBNull))  
				model.Modulecode = ( string)dr["modulecode"];
			if (dcc.Contains("modulename")&&!(dr["modulename"] is System.DBNull))  
				model.Modulename = ( string)dr["modulename"];
			if (dcc.Contains("parentcode")&&!(dr["parentcode"] is System.DBNull))  
				model.Parentcode = ( string)dr["parentcode"];
			if (dcc.Contains("sortorder")&&!(dr["sortorder"] is System.DBNull))  
				model.Sortorder = ( int)dr["sortorder"];
			if (dcc.Contains("plist")&&!(dr["plist"] is System.DBNull))  
				model.Plist = ( string)dr["plist"];
			if (dcc.Contains("purl")&&!(dr["purl"] is System.DBNull))  
				model.Purl = ( string)dr["purl"];
			if (dcc.Contains("pdact")&&!(dr["pdact"] is System.DBNull))  
				model.Pdact = ( string)dr["pdact"];
			if (dcc.Contains("enable")&&!(dr["enable"] is System.DBNull))  
				model.Enable = ( string)dr["enable"];
			if (dcc.Contains("remark")&&!(dr["remark"] is System.DBNull))  
				model.Remark = ( string)dr["remark"];
			if (dcc.Contains("mdate")&&!(dr["mdate"] is System.DBNull))  
				model.Mdate = ( DateTime)dr["mdate"];
			if (dcc.Contains("muser")&&!(dr["muser"] is System.DBNull))  
				model.Muser = ( string)dr["muser"];
			
			return model;
		}
    }
}
